package com.example.shengyin.service;

import com.example.shengyin.dao.AdminMapper;
import com.example.shengyin.dao.SymMapper;
import com.example.shengyin.entity.Admin;
import com.example.shengyin.entity.Page;
import com.example.shengyin.entity.Sym;
import com.example.shengyin.entity.common;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

/**
 * AdminService业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-29
 */
@Service
//@Transactional(readOnly = true, timeout = -1, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Cacheable(cacheNames = "admin",keyGenerator = "root")
public class SymService
{

    @Autowired
    private SymMapper dao;
    public Sym select(Long id)
    {
        return dao.select(id);
    }
    public List<Sym> list(Page page,Long sym)
    {
       return dao.list((page.getPage()-1)*page.getLimit(),page.getLimit(),sym);
    }
    public List<String> typelist(String sym)
    {
        return dao.typelist(sym);
    }
    public int count(Long sym)
    {
       return dao.count(sym);
    }
    @CacheEvict(allEntries = true,cacheNames = "admin")
    public int insert(Sym dAdmin)
    {
        return dao.insert(dAdmin);
    }
    @CacheEvict(allEntries = true,cacheNames = "admin")
    public int update(Sym dAdmin)
    {
        return dao.update(dAdmin);
    }
    @CacheEvict(allEntries = true,cacheNames = "admin")
    public int deleteByIds(String ids)
    {
        return dao.deleteByIds(ids);
    }
    @CacheEvict(allEntries = true,cacheNames = "admin")
    public int delete(int id)
    {
        return dao.delete(id);
    }

    public List<Sym> findSymtype() {
        return dao.findSymtype();
    }

    public List<common> symtype() {
        return dao.symtype();
    }

    public List<common> symlist(common common) {
        return dao.symlist(common);
    }

    public List<common> syminfo() {
        return dao.syminfo();
    }
}
